/**
 * @Title: PointService
 * @Package cn.com.yiqi.wsc.service.point
 * @Description: TODO
 * Copyright: Copyright (c) 2016
 * Company: 成都壹柒互动科技有限公司
 * @author 会员系统组-胥钰淋
 * @date 2017/2/9 17:33
 * @version V1.0
 */
package cn.com.yiqi.wsc.service.point;

import cn.com.yiqi.wsc.common.Result;
import cn.com.yiqi.wsc.dao.point.entity.PointRecordEntity;
import cn.com.yiqi.wsc.service.point.dataobject.PointInfoDO;
import cn.com.yiqi.wsc.service.point.dataobject.PointOrderDO;
import cn.com.yiqi.wsc.service.point.dataobject.QueryPointDO;
import com.github.pagehelper.PageInfo;

import java.util.Date;
import java.util.List;

/**
 *
 *@ClassName: PointService
 * @Description: TODO
 * @author 会员系统组-胥钰淋
 * @date 2017/2/9 17:33
 *
 */
public interface PointService {



    /**
     * 根据查询条件查询积分记录
     * @param query
     * @return
     */
    PageInfo<PointRecordEntity> queryPointRecord(QueryPointDO query);

    /**
     * 查询用户可用积分记录
     * @param customerId 客户id
     * @param invalidTime 积分过期时间
     * @return
     */
    List<PointRecordEntity> findAvailablePointRecord(long customerId, Date invalidTime);


    /**
     * 获得返点积分，交易结束赠送返回积分
     * @param pointOrderDO
     * @return
     */
    Result<Long> grantPoint(PointOrderDO pointOrderDO);

    /**
     * 后台操作赠送积分
     * @param pointOrderDO
     * @return
     */
    Result<Long> givePoint(PointOrderDO pointOrderDO);

    Result<Long> lotteryGetPoint(PointOrderDO pointOrderDO);

    /**
     * 积分兑换抽奖次数
     * @param pointOrderDO
     * @return
     */
    Result<Long> lotteryUsePoint(PointOrderDO pointOrderDO);

    /**
     * 交易中退还使用积分
     * @param pointOrderDO
     * @return
     */
    Result<Boolean> returnCostPoint(PointOrderDO pointOrderDO);

    /**
     * 投诉退还积分
     * @param pointOrderDO
     * @return
     */
    Result<Boolean> refundCostPoint(PointOrderDO pointOrderDO);

    /**
     *
     *
     */
    Result<Boolean> lotteryCostPoint(PointOrderDO pointOrderDO);

    /**
     * 积分兑换余额
     * @param pointOrderDO
     * @return
     */
    Result<Long> point2Balance(PointOrderDO pointOrderDO);

    /**
     * 获取客户积分兑换总数
     * @param customerId
     * @return
     */
    Long getPoint2BalanceTotalAmount(Long customerId,Date from,Date to,Integer type);

    /**
     *获取客户积分兑换次数
     * @param customerId
     * @param from
     *@param to
     * @param type
     * */
    Long getPoint2BalanceTotalTims(Long customerId,Date from,Date to,Integer type);

    /**
     * 签到获得积分
     * */
    Result<Long> singGetPoint(PointOrderDO pointOrderDO);

    /**
     * 申请额外兑换
     * */
    Result extraPointApply(Integer userId, Integer exchangePoint);

    /**
     * 额外兑换申请记录
     * */
    Result extraPointApplyRecord(Integer userId);

    /**
     * 交易使用
     *
     */
    Result<Long> dealUse(PointOrderDO pointOrderDO);

    /**
     * 分销获得积分
     * */
    Result<Long> spreadGet(PointOrderDO pointOrderDO);
}
